package com.basic.business.prodRel.domain;

import com.basic.common.core.domain.BaseEntity;
import com.basic.common.utils.DateUtils;
import com.basic.common.utils.SecurityUtils;
import lombok.Getter;
import lombok.Setter;
import com.basic.common.utils.StringUtils;
import com.basic.common.utils.uuid.ULID;

import java.util.ArrayList;
import java.util.List;

/**
 * 商品关系对象 t_prod_rel_main
 *
 * @author zhaoxy_jn@163.com
 * @date 2025-02-24
 */
@Getter
@Setter
public class TProdRelMain extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private String id;

    /** 店铺id */
    private String shopId;

    /** 店铺名称 */
    private String shopName;

    /** 链接地址 */
    private String link;

    /** 商品id */
    private String productId;

    /** 是否印刷品 Y是 N否 */
    private String printedMaterials;

    /** 状态 正常：NORMAL 删除：DELETED */
    private String prodStatus;

    /** 素材编码 */
    private String imgId;

    /** 材质编码 */
    private String imgMaterial;

    private List<TProdRelDetails> prodRelDetailsList = new ArrayList<>();

    public void setId(String id) {
        this.id = StringUtils.isNotEmpty(id) ? id : ULID.getId();
    }

    public TProdRelMain(){
        this.setCreateBy(SecurityUtils.getUsername());
        this.setCreateTime(DateUtils.getNowDate());
    }

    @Override
    public String toString() {
        return "TProdRelMain{" +
                "id='" + id + '\'' +
                ", shopId='" + shopId + '\'' +
                ", shopName='" + shopName + '\'' +
                ", link='" + link + '\'' +
                ", productId='" + productId + '\'' +
                ", printedMaterials='" + printedMaterials + '\'' +
                ", prodStatus='" + prodStatus + '\'' +
                ", imgId='" + imgId + '\'' +
                ", imgMaterial='" + imgMaterial + '\'' +
                ", prodRelDetailsList=" + prodRelDetailsList +
                '}';
    }
}
